package HLUserControl.Game;

import HLCode.HLRun;
import HLLib.base.HLAppConfig;
import HLLib.base.HLGraphics;
import HLLib.control.HLPanel;
import HLLib.handfere.HLCommunityData.HLGame.HLGame;
import HLLib.userControl.HLAchievementList;
import HLUserControl.GameButton;

public class GameAchievementPanel extends HLPanel {
    HLPanel prePanel;

    HLGame game;

    HLAchievementList achievementList;

    public GameAchievementPanel(HLGame game, HLPanel prePanel) {
        HLRun.SetGameFilePath(game.appid, game.appurl);
        HLAppConfig.appid = game.appid;
        GameButton.GetInstanse().Save();
        GameButton.GetInstanse().RefreshButton(-1, -1);
        this.prePanel = prePanel;
        this.game = game;
        achievementList = new HLAchievementList();
    }

    public void Logic() {
        if (achievementList.Logic() != 0) {
            removed = true;
            prePanel.Show();
            HLRun.SetSystemFilePath();
            GameButton.GetInstanse().Load();
        }
    }

    public void Render(HLGraphics g) {
        achievementList.Render(g);
    }

}
